package com.briup.day17;

/**
 * @author ThinkBook
 */
public class Test04_Enum {
    public static void main(String[] args) {
            Gender g1 = Gender.MALE;
            Gender g2 = Gender.FEMALE;
        System.out.println(g1);
        System.out.println(g2);
        System.out.println("---------");
        // 枚举类对象 其值 只能是 枚举元素
        //Gender g3 = Gender.BOY; ERROR

        System.out.println("---------");
        //测试Enum中的方法
        System.out.println(g1.name()+" "+g2.name());
        System.out.println(g1.ordinal()+" "+g2.ordinal());
    }
}
enum Gender{
    MALE,FEMALE
}
